package com.sfeir.server.servlet;

import java.io.IOException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.google.appengine.api.users.User;
import com.google.appengine.api.users.UserService;
import com.google.appengine.api.users.UserServiceFactory;

/**
 * Security servlet allowing simply to authenticate the user
 * 
 * @author Oussama Zoghlami
 * @date 28/12/2011
 */
public class SecurityServlet extends HttpServlet {

	private static final long serialVersionUID = -1284954052697506298L;

	private static final String GAME_URL = "Game.html";

	public void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		UserService userService = UserServiceFactory.getUserService();
		User user = userService.getCurrentUser();
		if (null != user) {

		}
		response.sendRedirect(GAME_URL);
	}

}
